import { http } from "@/utils/http";

// 获取学习包
export const getUserkngAPI = (conferenceId: string) => {
  return http.request({
    url: `/rest/api/userkng/conference/${conferenceId}`,
    method: "GET",
    useOriginRes: true
  });
};

// 生成学习课程
export const generateCourseAPI = (conferenceId: string) => {
  return http.request({
    url: `/rest/api/aichat/conference/${conferenceId}/sales/improvement`,
    method: "GET",
    useOriginRes: true
  });
};

// 获取视频地址
export const getPlayInfoAPI = (fileId: string) => {
  return http.request({
    url: `/rest/api/xmatefile/getPlayInfo?fileId=${fileId}&clientType=1`,
    method: "GET",
    useOriginRes: true
  });
};

// 更新课件学习状态
export const updateCourseStudyStatusAPI = (
  packageId: string,
  kngId: string,
  status: string
) => {
  return http.request({
    url: "/rest/api/userkng/study",
    method: "POST",
    useOriginRes: true,
    data: {
      packageId,
      kngId,
      status
    }
  });
};

// 获取能力提升要素
export const getImprovementAPI = () => {
  return http.request({
    url: "/rest/api/userkng/check/factor",
    method: "GET"
  });
};
